<div class="col-md-8 blog-main blog-show">

  <h1><%= @blog.title %></h1>

  <b><p class="breadcrumb-item active"><%= link_to @blog.topic.title, @blog.topic %></p></b>

  <nav aria-label="breadcrumb" class="breadcrumb ">
    <%= link_to "Home", root_path, class: "breadcrumb-item" %>
    <%= link_to @blog.topic.title, @blog.topic, class: "breadcrumb-item" %>
    <span class="breadcrumb-item active"><%= @blog.title %></span>

    <% if logged_in?(:site_admin) %>
      <span class="breadcrumb-item float-right">
        <%= link_to fa_icon("pencil-square-o"), edit_blog_path(@blog) %>
      </span>
      <span class="breadcrumb-item float-right">
        <%= link_to fa_icon("trash"), @blog, method: :delete, data: { confirm: 'Are you sure want to delete this blog post?' } %>
      </span>
    <% end %>
  </nav>

  <div>
    <%= image_tag @blog.main_image.to_s, width: "100%" %>
  </div>

  <p><%= markdown @blog.body %></p>

  <hr>
  
  <%= render "comments/comment_form" %>

  <br>

  <div id="comments" data-blog-id="<%= @blog.id %>">
    <%= render @blog.comments %>
  </div>

  <br>
</div>
